package fr.umlv.j2ee.patterns.sessionfacade;

import java.util.HashMap;

import javax.ejb.Stateless;

import fr.umlv.j2ee.patterns.transfertobject.Account;

@Stateless
public class AccountBean implements AccountBusiness {

	private HashMap<String, Account> map = new HashMap<String, Account>();


	@Override
	public void addAccount(Account a) {
		if(map.containsKey(a.getEmail()))
			return;

		map.put(a.getEmail(),a);

	}

	@Override
	public Account getAccount(String id) {
		System.out.println("get account "+id);
		return map.get(id);

	}

	@Override
	public void listAccount() {
		System.out.println(map.values());
	}

}
